package com.java110.mall.cart.bmo.storeOrder.impl;

import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.java110.mall.cart.bmo.storeOrder.ISaveStoreOrderBMO;
import com.java110.mall.cart.storeOrderEngine.StoreOrderEngine;
import com.java110.dto.storeOrder.StoreOrderReturnPayDto;
import com.java110.po.storeOrder.StoreOrderPo;
import com.java110.vo.ResultVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.stereotype.Service;

@Service("saveStoreOrderBMOImpl")
public class SaveStoreOrderBMOImpl implements ISaveStoreOrderBMO {

    @Autowired
    private StoreOrderEngine storeOrderEngine;

    /**
     * 添加小区信息
     *
     * @param reqJson
     * @return 订单服务能够接受的报文
     */
    public ResponseEntity<String> save(JSONObject reqJson) {
        //购买
        StoreOrderReturnPayDto storeOrderReturnPayDto = storeOrderEngine.unifiedOrder(reqJson);
        return ResultVo.createResponseEntity(ResultVo.CODE_OK, "保存成功", storeOrderReturnPayDto);

    }


    /**
     * 计算 服务费
     *
     * @param storeOrderPo
     * @param goodsList
     */
    private void computeStoreOrderServiceFee(StoreOrderPo storeOrderPo, JSONArray goodsList) {
    }


}
